﻿#if UNITY_EDITOR
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using Sirenix.OdinInspector;
using UnityEditor;

public class EditerTotalItemList<T> where T:MyScriptableObject
{
    [TableList(AlwaysExpanded =true, IsReadOnly = true)]
    public List<T> list;
    public EditerTotalItemList()
    {
        SetTotalList();
    }

    public void SetTotalList()
    {
        list = new List<T>();
        string path = TypeUtils.GetNameByT<T>() + "/";
        List<string> fileNames = EditerFilesManager.GetFiles(MyAssetsConfig.skillAssetsPath + path);
        for (int i = 0; i < fileNames.Count; i++)
        {
            T item = AssetDatabase.LoadAssetAtPath<T>(MyAssetsConfig.skillAssetsPath + path + fileNames[i]);
            list.Add(item);
        }
    }
}
#endif
